﻿<!--/* 
* Copyright (c) 2010, The University of Texas at Austin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, 
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, 
* this list of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
*
* Neither the name of The University of Texas at Austin nor the names of its contributors may be 
* used to endorse or promote products derived from this software without specific prior written 
* permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/-->
 <Window x:Class="Bio.Views.Structure.Editor.Views.ConfigureStructureElementVisualPropertiesEditor"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:julmar="http://www.julmar.com/wpfhelpers"
        xmlns:Converters="clr-namespace:Bio.Views.Structure.Editor.Internal.Converters"
        xmlns:Resources="clr-namespace:Bio.Views.Structure.Editor.Resources"
        xmlns:SEBehaviors="clr-namespace:Bio.Views.Structure.Editor.Internal.Behaviors"
        Title="Edit Structure Element Visual Properties" 
        Height="475" 
        Width="665"
        WindowStartupLocation="CenterOwner"
        WindowStyle="SingleBorderWindow"
        Background="DarkGray"
        ResizeMode="NoResize">
    <Grid>
        <Grid.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <Resources:DataTemplates />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <TextBlock Foreground="White" 
                   TextWrapping="Wrap" 
                   FontWeight="Bold" 
                   Margin="10"
                   Grid.Row="0"
                   Grid.Column="0">
            Edit Structure Element Rendering Properties.
        </TextBlock>

        <Grid Grid.Row="1"
              Margin="2">           
            <TabControl>
                <TabItem Header="Global">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.50*"></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                            
                        <ListBox Grid.Column="0"
                                 Margin="8"
                                 ItemsSource="{Binding Path=GlobalProperties}"
                                 SelectedItem="{Binding Path=SelectedGlobalProperty}">
                            <ListBox.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Header="Edit"
                                              Command="{Binding Path=AddGlobalPropertyEditCommand}"></MenuItem>
                                </ContextMenu>
                            </ListBox.ContextMenu>
                        </ListBox>
                            
                        <StackPanel Grid.Column="1"
                                    Margin="5">
                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideRenderingStyle, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.32*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Nucleotide Shape"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           TextWrapping="Wrap"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2"
                                        Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2">
                                    <ComboBox Padding="5"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=NucleotideRenderingStyle, Converter={Converters:InheritingNucleotideRenderingModeToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Text">Text</ComboBoxItem>
                                        <ComboBoxItem Tag="Circle">Circle</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>
                                
                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideRenderingStyle, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>
                        </StackPanel>
                    </Grid>
                </TabItem>
                <TabItem Header="NT Text">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition></RowDefinition>
                            <RowDefinition Height="30"></RowDefinition>
                        </Grid.RowDefinitions>
                        
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.50*"></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        
                        <TextBlock Grid.Column="0"
                                   Grid.ColumnSpan="2"
                                   Grid.Row="0"
                                   Margin="5,5,0,5"
                                   Foreground="{StaticResource TextBrush}">Edit Nucleotide Text Rendering Properties</TextBlock>
                        
                        <ListBox Grid.Column="0"
                                 Grid.Row="1"
                                 Margin="8"
                                 ItemsSource="{Binding Path=TextProperties}"
                                 SelectedItem="{Binding Path=SelectedTextProperty}">
                            <ListBox.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Header="Edit"
                                              Command="{Binding Path=AddTextPropertyEditCommand}"></MenuItem>
                                </ContextMenu>
                            </ListBox.ContextMenu>
                        </ListBox>

                        <StackPanel Grid.Column="1"
                                    Grid.Row="1"
                                    Margin="5">
                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideFontFamily, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Font"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        Margin="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center">
                                    <ComboBox Padding="5"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=NucleotideFontFamily, Converter={Converters:InheritingNucleotideFontFamilyToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Arial">Arial</ComboBoxItem>
                                        <ComboBoxItem Tag="Times">Times</ComboBoxItem>
                                        <ComboBoxItem Tag="Times New Roman">Times New Roman</ComboBoxItem>
                                        <ComboBoxItem Tag="Courier">Courier</ComboBoxItem>
                                        <ComboBoxItem Tag="Courier New">Courier New</ComboBoxItem>
                                        <ComboBoxItem Tag="Symbol">Symbol</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideFontFamily, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>


                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideFontStyle, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Style"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <ComboBox Padding="5"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=NucleotideFontStyle, Converter={Converters:InheritingNucleotideFontStyleToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Normal">Normal</ComboBoxItem>
                                        <ComboBoxItem Tag="Oblique">Oblique</ComboBoxItem>
                                        <ComboBoxItem Tag="Italic">Italic</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideFontStyle, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideFontWeight, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Weight"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                       Margin="2">
                                    <ComboBox Padding="5"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=NucleotideFontWeight, Converter={Converters:InheritingNucleotideFontWeightToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Normal">Regular</ComboBoxItem>
                                        <ComboBoxItem Tag="Bold">Bold</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideFontWeight, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideFontSize, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Size"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <ComboBox Padding="2"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedItem="{Binding Path=NucleotideFontSize, Converter={Converters:NullDoubleToDoubleConverter}}"
                                              ItemsSource="{StaticResource ValidNucleotideFontSizes}">
                                        <ComboBox.ItemTemplate>
                                            <DataTemplate>
                                                <TextBlock Name="cbNucleotideFontSizeSelectionList" Text="{Binding}" />
                                                <DataTemplate.Triggers>
                                                    <DataTrigger Binding="{Binding}" Value="-1.0">
                                                        <Setter TargetName="cbNucleotideFontSizeSelectionList" Property="Text" Value="Inheriting" />
                                                    </DataTrigger>
                                                </DataTemplate.Triggers>
                                            </DataTemplate>
                                        </ComboBox.ItemTemplate>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideFontSize, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideFill, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Fill"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Height="20"
                                        Margin="2">
                                    <Rectangle Fill="{Binding Path=NucleotideFill, Converter={Converters:NullBrushToTransparentConverter}}"
                                               Stroke="{Binding Path=NucleotideFill, Converter={Converters:InheritingBrushConverter}}">
                                        <Interactivity:Interaction.Triggers>
                                            <Interactivity:EventTrigger EventName="MouseLeftButtonDown">
                                                <julmar:InvokeCommand Command="{Binding Path=PromptForNucleotideFillBrushCommand}"></julmar:InvokeCommand>
                                            </Interactivity:EventTrigger>
                                        </Interactivity:Interaction.Triggers>
                                    </Rectangle>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideFill, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>
                        </StackPanel>

                        <StackPanel Grid.Row="2"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="2"
                                    Margin="5,0,0,0"
                                    Orientation="Horizontal">
                            <Button Grid.Column="0"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Margin="8,0,0,4"
                                    Padding="10,2"
                                    Command="{Binding Path=AddAllTextPropertyEditsCommand}">Select All</Button>

                            <Button Grid.Column="1"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Margin="8,0,0,4"
                                    Padding="10,2"
                                    Command="{Binding Path=ClearAllTextPropertyEditsCommand}">Clear All</Button>
                        </StackPanel>
                    </Grid>     
                </TabItem>
                <TabItem Header="NT Circle">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition></RowDefinition>
                            <RowDefinition Height="30"></RowDefinition>
                        </Grid.RowDefinitions>
                        
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.50*"></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0"
                                   Grid.ColumnSpan="2"
                                   Grid.Row="0"
                                   Margin="5,5,0,5"
                                   Foreground="{StaticResource TextBrush}">Edit Nucleotide Circle Rendering Properties</TextBlock>

                        <ListBox Grid.Column="0"
                                 Grid.Row="1"
                                 Margin="8"
                                 ItemsSource="{Binding Path=CircleProperties}"
                                 SelectedItem="{Binding Path=SelectedCircleProperty}">
                            <ListBox.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Header="Edit"
                                              Command="{Binding Path=AddCirclePropertyEditCommand}"></MenuItem>
                                </ContextMenu>
                            </ListBox.ContextMenu>
                        </ListBox>

                        <StackPanel Grid.Column="1"
                                    Grid.Row="1"
                                    Margin="5">
                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideCircleIsFilled, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Filled"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <ComboBox Padding="2"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=NucleotideCircleIsFilled, Converter={Converters:InheritingIsFilledToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Filled">Filled</ComboBoxItem>
                                        <ComboBoxItem Tag="NotFilled">Not Filled</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideCircleIsFilled, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideCircleDiameter, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Diameter"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <TextBox Padding="2"
                                             Text="{Binding Path=NucleotideCircleDiameter, Converter={Converters:NullDoubleToDoubleConverter}}">
                                        <Interactivity:Interaction.Behaviors>
                                            <SEBehaviors:InheritingNumericTextBoxBehavior />
                                        </Interactivity:Interaction.Behaviors>
                                    </TextBox>
                                    <Border.ToolTip>
                                        <TextBlock Text="Entering a negative value triggers Inheriting mode"></TextBlock>
                                    </Border.ToolTip>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideCircleDiameter, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideCircleEdgeThickness, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Thickness"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <TextBox Padding="2"
                                             Text="{Binding Path=NucleotideCircleEdgeThickness, Converter={Converters:NullDoubleToDoubleConverter}}">
                                        <Interactivity:Interaction.Behaviors>
                                            <SEBehaviors:InheritingNumericTextBoxBehavior />
                                        </Interactivity:Interaction.Behaviors>
                                    </TextBox>
                                    <Border.ToolTip>
                                        <TextBlock Text="Entering a negative value triggers Inheriting mode"></TextBlock>
                                    </Border.ToolTip>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideCircleEdgeThickness, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideCircleFill, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Fill"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Height="20"
                                        Margin="2">
                                    <Rectangle Fill="{Binding Path=NucleotideCircleFill, Converter={Converters:NullBrushToTransparentConverter}}"
                                               Stroke="{Binding Path=NucleotideCircleFill, Converter={Converters:InheritingBrushConverter}}">
                                        <Interactivity:Interaction.Triggers>
                                            <Interactivity:EventTrigger EventName="MouseLeftButtonDown">
                                                <julmar:InvokeCommand Command="{Binding Path=PromptForNucleotideCircleFillBrushCommand}"></julmar:InvokeCommand>
                                            </Interactivity:EventTrigger>
                                        </Interactivity:Interaction.Triggers>
                                    </Rectangle>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideCircleFill, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditNucleotideCircleStroke, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Stroke"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Height="20"
                                        Margin="2">
                                    <Rectangle Fill="{Binding Path=NucleotideCircleStroke, Converter={Converters:NullBrushToTransparentConverter}}"
                                               Stroke="{Binding Path=NucleotideCircleStroke, Converter={Converters:InheritingBrushConverter}}">
                                        <Interactivity:Interaction.Triggers>
                                            <Interactivity:EventTrigger EventName="MouseLeftButtonDown">
                                                <julmar:InvokeCommand Command="{Binding Path=PromptForNucleotideCircleStrokeBrushCommand}"></julmar:InvokeCommand>
                                            </Interactivity:EventTrigger>
                                        </Interactivity:Interaction.Triggers>
                                    </Rectangle>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditNucleotideCircleStroke, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>
                        </StackPanel>
                        
                        <StackPanel Grid.Row="2"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="2"
                                    Margin="5,0,0,0"
                                    Orientation="Horizontal">
                            <Button Grid.Column="0"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Margin="8,0,0,4"
                                    Padding="10,2"
                                    Command="{Binding Path=AddAllCirclePropertyEditsCommand}">Select All</Button>
                            
                            <Button Grid.Column="1"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Margin="8,0,0,4"
                                    Padding="10,2"
                                    Command="{Binding Path=ClearAllCirclePropertyEditsCommand}">Clear All</Button>
                        </StackPanel>
                    </Grid>      
                </TabItem>
                <TabItem Header="BP Connector"
                         Visibility="{Binding Path=EditingNucleotideProperties, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Visible, TrueTreatment=Hidden}}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition></RowDefinition>
                            <RowDefinition Height="30"></RowDefinition>
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.50*"></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <TextBlock Grid.Column="0"
                                   Grid.ColumnSpan="2"
                                   Grid.Row="0"
                                   Margin="5,5,0,5"
                                   Foreground="{StaticResource TextBrush}">Edit Base Pair Connector Rendering Properties</TextBlock>

                        <ListBox Grid.Column="0"
                                 Grid.Row="1"
                                 Margin="8"
                                 ItemsSource="{Binding Path=BasePairConnectorProperties}"
                                 SelectedItem="{Binding Path=SelectedConnectorProperty}">
                            <ListBox.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Header="Edit"
                                              Command="{Binding Path=AddConnectorPropertyEditCommand}"></MenuItem>
                                </ContextMenu>
                            </ListBox.ContextMenu>
                        </ListBox>

                        <StackPanel Grid.Column="1"
                                    Grid.Row="1"
                                    Margin="5">
                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorRenderingStyle, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Style"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2"
                                        Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2">
                                    <ComboBox Padding="2"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=BasePairConnectorRenderingStyle, Converter={Converters:InheritingBasePairConnectorRenderingModeToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Line">Line</ComboBoxItem>
                                        <ComboBoxItem Tag="Circle">Circle</ComboBoxItem>
                                        <ComboBoxItem Tag="Rectangle">Rectangle</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorRenderingStyle, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorIsVisible, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Visible"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <ComboBox Padding="2"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=BasePairConnectorIsVisible, Converter={Converters:InheritingBasePairConnectorIsVisibleToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Visible">Visible</ComboBoxItem>
                                        <ComboBoxItem Tag="Hidden">Hidden</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorIsVisible, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorIsFilled, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Filled"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <ComboBox Padding="2"
                                              IsEditable="True"
                                              IsReadOnly="True"
                                              SelectedValue="{Binding Path=BasePairConnectorIsFilled, Converter={Converters:InheritingIsFilledToStringConverter}}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="Filled">Filled</ComboBoxItem>
                                        <ComboBoxItem Tag="NotFilled">Not Filled</ComboBoxItem>
                                        <ComboBoxItem Tag="Inherited">Inheriting</ComboBoxItem>
                                    </ComboBox>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorIsFilled, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorSize, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Size"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <TextBox Padding="2"
                                             Text="{Binding Path=BasePairConnectorSize, Converter={Converters:NullDoubleToDoubleConverter}}">
                                        <Interactivity:Interaction.Behaviors>
                                            <SEBehaviors:InheritingNumericTextBoxBehavior />
                                        </Interactivity:Interaction.Behaviors>
                                    </TextBox>
                                    <Border.ToolTip>
                                        <TextBlock Text="Entering a negative value triggers Inheriting mode"></TextBlock>
                                    </Border.ToolTip>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorSize, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorStrokeThickness, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Thickness"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Row="0"
                                        Grid.Column="1"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Margin="2">
                                    <TextBox Padding="2"
                                             Text="{Binding Path=BasePairConnectorStrokeThickness, Converter={Converters:NullDoubleToDoubleConverter}}">
                                        <Interactivity:Interaction.Behaviors>
                                            <SEBehaviors:InheritingNumericTextBoxBehavior />
                                        </Interactivity:Interaction.Behaviors>
                                    </TextBox>
                                    <Border.ToolTip>
                                        <TextBlock Text="Entering a negative value triggers Inheriting mode"></TextBlock>
                                    </Border.ToolTip>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorStrokeThickness, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorFill, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Fill"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Height="20"
                                        Margin="2">
                                    <Rectangle Fill="{Binding Path=BasePairConnectorFill, Converter={Converters:NullBrushToTransparentConverter}}"
                                               Stroke="{Binding Path=BasePairConnectorFill, Converter={Converters:InheritingBrushConverter}}">
                                        <Interactivity:Interaction.Triggers>
                                            <Interactivity:EventTrigger EventName="MouseLeftButtonDown">
                                                <julmar:InvokeCommand Command="{Binding Path=PromptForConnectorFillBrushCommand}"></julmar:InvokeCommand>
                                            </Interactivity:EventTrigger>
                                        </Interactivity:Interaction.Triggers>
                                    </Rectangle>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorFill, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>

                            <Grid Margin="2"
                                  Visibility="{Binding Path=EditBasePairConnectorStroke, Converter={julmar:BooleanToVisibilityConverter FalseTreatment=Collapsed, TrueTreatment=Visible}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.27*"></ColumnDefinition>
                                    <ColumnDefinition></ColumnDefinition>
                                    <ColumnDefinition Width="0.25*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>

                                <TextBlock Text="Stroke"
                                           Grid.Column="0"
                                           Grid.Row="0"
                                           Margin="5,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Foreground="{StaticResource TextBrush}">
                                </TextBlock>

                                <Border Grid.Column="1"
                                        Grid.Row="0"
                                        Padding="2"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Height="20"
                                        Margin="2">
                                    <Rectangle Fill="{Binding Path=BasePairConnectorStroke, Converter={Converters:NullBrushToTransparentConverter}}"
                                               Stroke="{Binding Path=BasePairConnectorStroke, Converter={Converters:InheritingBrushConverter}}">
                                        <Interactivity:Interaction.Triggers>
                                            <Interactivity:EventTrigger EventName="MouseLeftButtonDown">
                                                <julmar:InvokeCommand Command="{Binding Path=PromptForConnectorStrokeBrushCommand}"></julmar:InvokeCommand>
                                            </Interactivity:EventTrigger>
                                        </Interactivity:Interaction.Triggers>
                                    </Rectangle>
                                </Border>

                                <CheckBox HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          Margin="2"
                                          Grid.Column="2"
                                          Grid.Row="0"
                                          IsEnabled="True"
                                          IsChecked="{Binding Path=EditBasePairConnectorStroke, Mode=TwoWay}">
                                    <CheckBox.ToolTip>
                                        <TextBlock>Uncheck to remove this Property Edit</TextBlock>
                                    </CheckBox.ToolTip>
                                </CheckBox>
                            </Grid>
                        </StackPanel>

                        <StackPanel Grid.Row="2"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="2"
                                    Margin="5,0,0,0"
                                    Orientation="Horizontal">
                            <Button Grid.Column="0"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Margin="8,0,0,4"
                                    Padding="10,2"
                                    Command="{Binding Path=AddAllConnectorPropertyEditsCommand}">Select All</Button>

                            <Button Grid.Column="1"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Margin="8,0,0,4"
                                    Padding="10,2"
                                    Command="{Binding Path=ClearAllConnectorPropertyEditsCommand}">Clear All</Button>
                        </StackPanel>
                    </Grid>
                </TabItem>
            </TabControl> 
        </Grid>

        <StackPanel Margin="5"
                    Grid.Row="2"
                    Grid.Column="0"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right">
            <Button Content="Add Filter" MinWidth="75" Padding="10,5" Margin="5"
                    Visibility="{Binding Path=ShowCreateFilter, Converter={julmar:BooleanToVisibilityConverter TrueTreatment=Visible, FalseTreatment=Hidden}}">
                <Interactivity:Interaction.Triggers>
                    <Interactivity:EventTrigger EventName="Click">
                        <julmar:InvokeCommand Command="{Binding Path=AddFilterConditionCommand}" />
                    </Interactivity:EventTrigger>
                </Interactivity:Interaction.Triggers>
            </Button>
            <Button Content="OK" MinWidth="75" Padding="10,5" Margin="5" IsDefault="True">
                <Interactivity:Interaction.Behaviors>
                    <julmar:CloseDialogBehavior DialogResult="True" />
                </Interactivity:Interaction.Behaviors>
            </Button>
            <Button Content="Cancel" MinWidth="75" Padding="10,5" Margin="5" IsCancel="True" />
        </StackPanel>
    </Grid>
</Window>
